package com.fj.user.mq.listener;

import com.alibaba.fastjson.JSONObject;
import com.fj.domain.Order;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @author fj
 * @date 2024/3/14 16:48
 */
@Component
@Slf4j
@RocketMQMessageListener(topic = "${param.mq.orderTopic}", consumerGroup = "GID_SHOP_USER")
public class OrderMessageConsumer implements RocketMQListener<Order> {
    @Override
    public void onMessage(Order order) {
        log.info("收到消息{}", JSONObject.toJSONString(order));
    }
}
